﻿#include "DANodeMetaData.h"
QString full_name(const DANodeMetaData &a);

QString full_name(const DANodeMetaData &a)
{
    return (a.getGroup() + a.getNodePrototype());
}

DANodeMetaData::DANodeMetaData() {}

DANodeMetaData::DANodeMetaData(const QString &prototype) : m_prototype(prototype) {}

DANodeMetaData::DANodeMetaData(const QString &prototype, const QString &name, const QIcon &icon, const QString &group)
    : m_prototype(prototype), m_nodeName(name), m_nodeIcon(icon), m_group(group)
{
}

QString DANodeMetaData::getNodePrototype() const
{
    return (m_prototype);
}

void DANodeMetaData::setNodePrototype(const QString &prototype)
{
    m_prototype = prototype;
}

QString DANodeMetaData::getNodeName() const
{
    return (m_nodeName);
}

void DANodeMetaData::setNodeName(const QString &name)
{
    m_nodeName = name;
}

QIcon DANodeMetaData::getIcon() const
{
    return (m_nodeIcon);
}

void DANodeMetaData::setIcon(const QIcon &icon)
{
    m_nodeIcon = icon;
}

QString DANodeMetaData::getGroup() const
{
    return (m_group);
}

void DANodeMetaData::setGroup(const QString &group)
{
    m_group = group;
}

uint qHash(const DANodeMetaData &key, uint seed)
{
    return (qHash(full_name(key), seed));
}

bool operator<(const DANodeMetaData &a, const DANodeMetaData &b)
{
    return (full_name(a) < full_name(b));
}

bool operator==(const DANodeMetaData &a, const DANodeMetaData &b)
{
    return (full_name(a) == full_name(b));
}
